<template>
<div>
  <DaoHang1Vue :messageData="messageData" :identityChangeData="identityChangeData" :username="username"></DaoHang1Vue>
  <DropDownListVue :ListData="ListData" :username="username"></DropDownListVue>
  <InfoBoxVue></InfoBoxVue>
  </div>
</template>

<script>
import axios from 'axios'
import DaoHang1Vue from './components/DaoHang1.vue'
import DropDownListVue from './components/DropDownList.vue'
import InfoBoxVue from './components/InfoBox.vue'


export default {
  data(){
    return {
      username: '',
      data:{},
      //后续添加导航栏在这里按照格式加
          ListData:[
            {
              title:'师生双选管理',
              children: [
                {
                title: '学生选题',
                location: '/#/student/bisheInfo/',
                },
                {
                  title:'我的选题',
                  location: `/#/student/myBishe/`,
                },
                ],
              },
              {
                title: '提交文件',
                children: [
                  {
                    title: '报告',
                    location: '/#/student/upload',
                  },
                  
                  
                ]
              },
          ],
           
             

              //根据身份不同变化的数据
              identityChangeData:[
                {
                  skillName: '个人中心',
                  location: ''
                },
                {
                  skillName: '退出登录',
                  location: '/#/'
                }
              ],
    }
  },
  components: {
      DropDownListVue,
      DaoHang1Vue,
      InfoBoxVue,
  },
  created(){
    this.username = this.$route.query.username
    this.data = this.$route.query.data
    this.identity = this.$route.query.identity
    console.log(this.data);
      this.identityChangeData.forEach(e =>{
        if(e.skillName === '个人中心')
          e.location = `/#/${this.identity}/personalInfo?username=${this.username}&identity=${this.identity}`
      })
    
  },
  methods:{
      initData(){
        axios.get("地址")
        .then(response => {
          this.title = response.data.title;
          this.content = response.data.content;
        })
        .catch(error => {
          console.error('Error fetching data:', error);
        });
      }

  }
}
</script>

<style>

</style>